package io.litchi.auth.domain.entity.auth;

import io.litchi.common.base.BaseEntity;
import jakarta.persistence.*;
import lombok.*;
import lombok.experimental.FieldDefaults;
import org.hibernate.annotations.Comment;

/**
 * description: 用户角色中间表
 *
 * @author helang
 * @since 2025-09-18
 */
@EqualsAndHashCode(callSuper = false, of = "id")
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
@FieldDefaults(level = AccessLevel.PRIVATE)
@Table(name = "user_role")
@Comment("用户角色中间表")
public class UserRole extends BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false, unique = true, columnDefinition = "BIGINT(20) COMMENT '主键id'")
    Long id;

    @Column(name = "user_id",nullable = false, columnDefinition = "BIGINT(20) COMMENT '用户id'")
    Long userId;

    @Column(name = "role_id",nullable = false, columnDefinition = "BIGINT(20) COMMENT '角色id'")
    Long roleId;


}